<!DOCTYPE html>
<html lang="en" xmlns:th="http://www.thymeleaf.org">
<body>
<nav class="pagination" th:fragment="pageNav(pageInfo)">
    <!--前一页-->
    <th:block th:if="${pageInfo.hasPrevious()}">
        <a class="extend prev" rel="prev" th:href="@{'?pageNo='+${pageInfo.getNumber()-1}}">
            <i class="fa fa-angle-left"></i>
        </a>
    </th:block>

    <!--页码数字-->
    <th:block th:each=" nav : ${#numbers.sequence(0,pageInfo.getTotalPages()-1)}">
        <span th:class="${nav==pageInfo.getNumber()} ? 'current' : ''">
            <a class="page-number" th:href="@{'?pageNo='+${nav} }" th:text="${nav+1}"></a>

        </span>
    </th:block>

    <!--后一页-->
    <th:block th:if="${pageInfo.hasNext()}">
        <a class="extend next" rel="next" th:href="@{'?pageNo='+${pageInfo.getNumber()+1}}">
            <i class="fa fa-angle-right"></i>
        </a>
    </th:block>
</nav>
</body>
</html>